<template>
  <div class="">
    <el-card class="box-card">
      <el-row type="flex" justify="end">
        <el-col :span="18"
          ><h3 class="font" v-if="AddisShow">增加试题</h3></el-col
        >
        <el-col :span="6" :push="4">
          <el-button
            type="primary"
            plain
            size="small"
            class="btn"
            @click="isShow"
            >{{ !AddisShow ? "创建试卷" : "返回列表" }}</el-button
          ></el-col
        >
      </el-row>
      <PaperAdd v-if="AddisShow" @CloseAdd="CloseAdd" ref="addPaper" ></PaperAdd>
      <PaperList v-else @edit='editPaper'></PaperList>
    </el-card>
  </div>
</template>
<script>
import PaperList from "@/components/PaperList";
import PaperAdd from "@/components/PaperAdd";
import WangEditor from "@/components/WangEditor";
export default {
  name: "",
  components: { PaperList, PaperAdd, WangEditor },
  data() {
    return {
      AddisShow: false,
      needId:null
    };
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    isShow() {
      this.AddisShow = !this.AddisShow;
    },
    CloseAdd(CloseAdd) {
      this.AddisShow = CloseAdd;
    },
    editPaper(row){
      this.AddisShow=true
       this.$nextTick(()=>{
       this.$refs.addPaper.editPaper(row.id)
     });
    }
  },
};
</script>
<style lang="scss" scoped></style>
